class Page3 extends egret.Sprite{
	private building:egret.Bitmap;
	private blink:egret.Bitmap;
	private arr_pic;
	public constructor() {
		super();
		this.initial();
	}
	public initial(){
		var bg=new egret.Bitmap(RES.getRes("bg3_png"));
		this.addChild(bg);

		this.arr_pic=new Array();
		for(var z=1;z<=6;z++){
			var pic=new egret.Bitmap(RES.getRes("page3pic"+z+"_png"));
			this.addChild(pic);
			switch(z){
				case 1:pic.x=168;pic.y=292;break;
				case 2:pic.x=339;pic.y=481;break;
				case 3:pic.x=168;pic.y=521;break;
				case 4:pic.x=104;pic.y=628;break;
				case 5:pic.x=248;pic.y=778;break;
				case 6:pic.x=118;pic.y=893;break;
			}
			this.arr_pic.push(pic);
		}
		this.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.TB,this);

	}
	private TB(e:TouchEvent){
		this.touchEnabled=false;
		GoEvent.msg.dispatchEvent(new GoEvent("ChangePage","4"));
	}
	public End(){
		egret.Tween.get(this).to({alpha:0},600,egret.Ease.cubicOut);
	}

	public Show(){
		// this.touchEnabled=true;
		var This=this;
		setTimeout(function(){
			This.touchEnabled=true;
		},3000)

		var balaThis=this;
		this.alpha=0;
		egret.Tween.get(this).to({alpha:1},700,egret.Ease.cubicOut);

		for(var z=0;z<this.arr_pic.length;z++){
			this.arr_pic[z].alpha=0;
			this.arr_pic[z].y+=50;

			if(z==1){
				this.arr_pic[z].y=481-50;
				egret.Tween.get(this.arr_pic[z]).wait(200+z*400).to({alpha:1,y:481},800,egret.Ease.cubicOut);
			}
			else if(z==2){
				this.arr_pic[z].y=521-10;
				egret.Tween.get(this.arr_pic[z]).wait(200+z*500).to({alpha:1,y:521},800,egret.Ease.cubicOut);
		
			}
			else if(z==0){
				this.arr_pic[z].y=292-50;
				egret.Tween.get(this.arr_pic[z]).wait(1700+z*400).to({alpha:1,y:292},800,egret.Ease.cubicOut);
			}
			else {
				egret.Tween.get(this.arr_pic[z]).wait(500+z*400).to({alpha:1,y:this.arr_pic[z].y-50},800,egret.Ease.cubicOut);
			}

			
		}
	}
}